package com.leinao.media;

import com.leinao.media.client.MediaClient;
import com.leinao.media.common.Result;
import com.leinao.media.common.param.BaseDeviceParam;
import com.leinao.media.factory.ServiceFactory;
import com.leinao.media.service.MediaService;

/**
 * @author zhangyu
 * @date 2022/7/15 15:33
 */
public class Test {

    public static void main(String[] args) {

        MediaClient mediaClient = MediaClient.newBuilder()
                .appId("123")
                .host("http://192.168.7.102:8484")
                .priKey("RSA1234567")
//                .options(ClientOptions.newBuilder().readTimeOut(1000L).connectTimeOut(1000L).build())
                .build();

        System.out.println(mediaClient);


        MediaService mediaService = ServiceFactory.register(MediaService.class, mediaClient);

        BaseDeviceParam param = new BaseDeviceParam();
        param.setIp("192.168.6.230");
        param.setPort("8000");
        param.setUserName("admin");
        param.setPassword("asdf123456");
        param.setType(1);

//        Result<Long> result = mediaService.login(param);

        Result<Void> result = mediaService.activateDevice(param);
        System.out.println(result);


    }

}
